import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Text widget',
      home: Scaffold(
        appBar: AppBar(title: Text('aaa')),
        body: Center(
          //相当于 div
          child: Container(
            child: new Text('hello jspang,', style: TextStyle(fontSize: 40.0)),
            alignment: Alignment.topLeft, //子组件的对其方式
            width: 500.0,
            height: 400.0,
            // padding: const EdgeInsets.all(10.0),  //边距
            padding: const EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 10.0), //左上右下
            margin: const EdgeInsets.all(20.0),
            // color: Colors.lightBlue,
            decoration:new BoxDecoration(

              //渐变颜色
              gradient: const LinearGradient(
                colors: [
                  Colors.lightBlue,Colors.greenAccent,Colors.purple
                ]
              ),
              // 边框
              border: Border.all(width: 5.0,color: Colors.red)
            ) ,
          ),
        ),
      ),
    );
  }
}
